Optimal. Leaf size=172 \[ -\frac {45 x^2}{128 b^2}+\frac {3 x^4}{32}-\frac {45 \cos ^2(a+b x)}{128 b^4}+\frac {9 x^2 \cos ^2(a+b x)}{16 b^2}-\frac {3 \cos ^4(a+b x)}{128 b^4}+\frac {3 x^2 \cos ^4(a+b x)}{16 b^2}-\frac {45 x \cos (a+b x) \sin (a+b x)}{64 b^3}+\frac {3 x^3 \cos (a+b x) \sin (a+b x)}{8 b}-\frac {3 x \cos ^3(a+b x) \sin (a+b x)}{32 b^3}+\frac {x^3 \cos ^3(a+b x) \sin (a+b x)}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 172, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3392, 30, 3391}
\begin {gather*} -\frac {3 \cos ^4(a+b x)}{128 b^4}-\frac {45 \cos ^2(a+b x)}{128 b^4}-\frac {3 x \sin (a+b x) \cos ^3(a+b x)}{32 b^3}-\frac {45 x \sin (a+b x) \cos (a+b x)}{64 b^3}+\frac {3 x^2 \cos ^4(a+b x)}{16 b^2}+\frac {9 x^2 \cos ^2(a+b x)}{16 b^2}+\frac {x^3 \sin (a+b x) \cos ^3(a+b x)}{4 b}+\frac {3 x^3 \sin (a+b x) \cos (a+b x)}{8 b}-\frac {45 x^2}{128 b^2}+\frac {3 x^4}{32} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 3391
Rule 3392
Rubi steps
\begin {align*} \int x^3 \cos ^4(a+b x) \, dx &=\frac {3 x^2 \cos ^4(a+b x)}{16 b^2}+\frac {x^3 \cos ^3(a+b x) \sin (a+b x)}{4 b}+\frac {3}{4} \int x^3 \cos ^2(a+b x) \, dx-\frac {3 \int x \cos ^4(a+b x) \, dx}{8 b^2}\\ &=\frac {9 x^2 \cos ^2(a+b x)}{16 b^2}-\frac {3 \cos ^4(a+b x)}{128 b^4}+\frac {3 x^2 \cos ^4(a+b x)}{16 b^2}+\frac {3 x^3 \cos (a+b x) \sin (a+b x)}{8 b}-\frac {3 x \cos ^3(a+b x) \sin (a+b x)}{32 b^3}+\frac {x^3 \cos ^3(a+b x) \sin (a+b x)}{4 b}+\frac {3 \int x^3 \, dx}{8}-\frac {9 \int x \cos ^2(a+b x) \, dx}{32 b^2}-\frac {9 \int x \cos ^2(a+b x) \, dx}{8 b^2}\\ &=\frac {3 x^4}{32}-\frac {45 \cos ^2(a+b x)}{128 b^4}+\frac {9 x^2 \cos ^2(a+b x)}{16 b^2}-\frac {3 \cos ^4(a+b x)}{128 b^4}+\frac {3 x^2 \cos ^4(a+b x)}{16 b^2}-\frac {45 x \cos (a+b x) \sin (a+b x)}{64 b^3}+\frac {3 x^3 \cos (a+b x) \sin (a+b x)}{8 b}-\frac {3 x \cos ^3(a+b x) \sin (a+b x)}{32 b^3}+\frac {x^3 \cos ^3(a+b x) \sin (a+b x)}{4 b}-\frac {9 \int x \, dx}{64 b^2}-\frac {9 \int x \, dx}{16 b^2}\\ &=-\frac {45 x^2}{128 b^2}+\frac {3 x^4}{32}-\frac {45 \cos ^2(a+b x)}{128 b^4}+\frac {9 x^2 \cos ^2(a+b x)}{16 b^2}-\frac {3 \cos ^4(a+b x)}{128 b^4}+\frac {3 x^2 \cos ^4(a+b x)}{16 b^2}-\frac {45 x \cos (a+b x) \sin (a+b x)}{64 b^3}+\frac {3 x^3 \cos (a+b x) \sin (a+b x)}{8 b}-\frac {3 x \cos ^3(a+b x) \sin (a+b x)}{32 b^3}+\frac {x^3 \cos ^3(a+b x) \sin (a+b x)}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.28, size = 100, normalized size = 0.58 \begin {gather*} \frac {192 \left (-1+2 b^2 x^2\right ) \cos (2 (a+b x))+3 \left (-1+8 b^2 x^2\right ) \cos (4 (a+b x))+4 b x \left (24 b^3 x^3+32 \left (-3+2 b^2 x^2\right ) \sin (2 (a+b x))+\left (-3+8 b^2 x^2\right ) \sin (4 (a+b x))\right )}{1024 b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(431\) vs.
\(2(152)=304\).
time = 0.12, size = 432, normalized size = 2.51
method | result | size |
risch | \(\frac {3 x^{4}}{32}+\frac {3 \left (8 x^{2} b^{2}-1\right ) \cos \left (4 b x +4 a \right )}{1024 b^{4}}+\frac {x \left (8 x^{2} b^{2}-3\right ) \sin \left (4 b x +4 a \right )}{256 b^{3}}+\frac {3 \left (2 x^{2} b^{2}-1\right ) \cos \left (2 b x +2 a \right )}{16 b^{4}}+\frac {x \left (2 x^{2} b^{2}-3\right ) \sin \left (2 b x +2 a \right )}{8 b^{3}}\) | \(105\) |
derivativedivides | \(\frac {-a^{3} \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )+3 a^{2} \left (\left (b x +a \right ) \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )-\frac {3 \left (b x +a \right )^{2}}{16}+\frac {\left (2 \left (\cos ^{2}\left (b x +a \right )\right )+3\right )^{2}}{64}\right )-3 a \left (\left (b x +a \right )^{2} \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )+\frac {\left (b x +a \right ) \left (\cos ^{4}\left (b x +a \right )\right )}{8}-\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{32}-\frac {15 b x}{64}-\frac {15 a}{64}+\frac {3 \left (b x +a \right ) \left (\cos ^{2}\left (b x +a \right )\right )}{8}-\frac {3 \cos \left (b x +a \right ) \sin \left (b x +a \right )}{16}-\frac {\left (b x +a \right )^{3}}{4}\right )+\left (b x +a \right )^{3} \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )+\frac {3 \left (b x +a \right )^{2} \left (\cos ^{4}\left (b x +a \right )\right )}{16}-\frac {3 \left (b x +a \right ) \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )}{8}+\frac {45 \left (b x +a \right )^{2}}{128}-\frac {3 \left (2 \left (\cos ^{2}\left (b x +a \right )\right )+3\right )^{2}}{512}+\frac {9 \left (b x +a \right )^{2} \left (\cos ^{2}\left (b x +a \right )\right )}{16}-\frac {9 \left (b x +a \right ) \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )}{8}+\frac {9 \left (\sin ^{2}\left (b x +a \right )\right )}{32}-\frac {9 \left (b x +a \right )^{4}}{32}}{b^{4}}\) | \(432\) |
default | \(\frac {-a^{3} \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )+3 a^{2} \left (\left (b x +a \right ) \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )-\frac {3 \left (b x +a \right )^{2}}{16}+\frac {\left (2 \left (\cos ^{2}\left (b x +a \right )\right )+3\right )^{2}}{64}\right )-3 a \left (\left (b x +a \right )^{2} \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )+\frac {\left (b x +a \right ) \left (\cos ^{4}\left (b x +a \right )\right )}{8}-\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{32}-\frac {15 b x}{64}-\frac {15 a}{64}+\frac {3 \left (b x +a \right ) \left (\cos ^{2}\left (b x +a \right )\right )}{8}-\frac {3 \cos \left (b x +a \right ) \sin \left (b x +a \right )}{16}-\frac {\left (b x +a \right )^{3}}{4}\right )+\left (b x +a \right )^{3} \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )+\frac {3 \left (b x +a \right )^{2} \left (\cos ^{4}\left (b x +a \right )\right )}{16}-\frac {3 \left (b x +a \right ) \left (\frac {\left (\cos ^{3}\left (b x +a \right )+\frac {3 \cos \left (b x +a \right )}{2}\right ) \sin \left (b x +a \right )}{4}+\frac {3 b x}{8}+\frac {3 a}{8}\right )}{8}+\frac {45 \left (b x +a \right )^{2}}{128}-\frac {3 \left (2 \left (\cos ^{2}\left (b x +a \right )\right )+3\right )^{2}}{512}+\frac {9 \left (b x +a \right )^{2} \left (\cos ^{2}\left (b x +a \right )\right )}{16}-\frac {9 \left (b x +a \right ) \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )}{8}+\frac {9 \left (\sin ^{2}\left (b x +a \right )\right )}{32}-\frac {9 \left (b x +a \right )^{4}}{32}}{b^{4}}\) | \(432\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 303, normalized size = 1.76 \begin {gather*} \frac {96 \, {\left (b x + a\right )}^{4} - 32 \, {\left (12 \, b x + 12 \, a + \sin \left (4 \, b x + 4 \, a\right ) + 8 \, \sin \left (2 \, b x + 2 \, a\right )\right )} a^{3} + 24 \, {\left (24 \, {\left (b x + a\right )}^{2} + 4 \, {\left (b x + a\right )} \sin \left (4 \, b x + 4 \, a\right ) + 32 \, {\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right ) + \cos \left (4 \, b x + 4 \, a\right ) + 16 \, \cos \left (2 \, b x + 2 \, a\right )\right )} a^{2} - 12 \, {\left (32 \, {\left (b x + a\right )}^{3} + 4 \, {\left (b x + a\right )} \cos \left (4 \, b x + 4 \, a\right ) + 64 \, {\left (b x + a\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (8 \, {\left (b x + a\right )}^{2} - 1\right )} \sin \left (4 \, b x + 4 \, a\right ) + 32 \, {\left (2 \, {\left (b x + a\right )}^{2} - 1\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} a + 3 \, {\left (8 \, {\left (b x + a\right )}^{2} - 1\right )} \cos \left (4 \, b x + 4 \, a\right ) + 192 \, {\left (2 \, {\left (b x + a\right )}^{2} - 1\right )} \cos \left (2 \, b x + 2 \, a\right ) + 4 \, {\left (8 \, {\left (b x + a\right )}^{3} - 3 \, b x - 3 \, a\right )} \sin \left (4 \, b x + 4 \, a\right ) + 128 \, {\left (2 \, {\left (b x + a\right )}^{3} - 3 \, b x - 3 \, a\right )} \sin \left (2 \, b x + 2 \, a\right )}{1024 \, b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 115, normalized size = 0.67 \begin {gather*} \frac {12 \, b^{4} x^{4} + 3 \, {\left (8 \, b^{2} x^{2} - 1\right )} \cos \left (b x + a\right )^{4} - 45 \, b^{2} x^{2} + 9 \, {\left (8 \, b^{2} x^{2} - 5\right )} \cos \left (b x + a\right )^{2} + 2 \, {\left (2 \, {\left (8 \, b^{3} x^{3} - 3 \, b x\right )} \cos \left (b x + a\right )^{3} + 3 \, {\left (8 \, b^{3} x^{3} - 15 \, b x\right )} \cos \left (b x + a\right )\right )} \sin \left (b x + a\right )}{128 \, b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.64, size = 253, normalized size = 1.47 \begin {gather*} \begin {cases} \frac {3 x^{4} \sin ^{4}{\left (a + b x \right )}}{32} + \frac {3 x^{4} \sin ^{2}{\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{16} + \frac {3 x^{4} \cos ^{4}{\left (a + b x \right )}}{32} + \frac {3 x^{3} \sin ^{3}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{8 b} + \frac {5 x^{3} \sin {\left (a + b x \right )} \cos ^{3}{\left (a + b x \right )}}{8 b} - \frac {45 x^{2} \sin ^{4}{\left (a + b x \right )}}{128 b^{2}} - \frac {9 x^{2} \sin ^{2}{\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{64 b^{2}} + \frac {51 x^{2} \cos ^{4}{\left (a + b x \right )}}{128 b^{2}} - \frac {45 x \sin ^{3}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{64 b^{3}} - \frac {51 x \sin {\left (a + b x \right )} \cos ^{3}{\left (a + b x \right )}}{64 b^{3}} + \frac {45 \sin ^{4}{\left (a + b x \right )}}{256 b^{4}} - \frac {51 \cos ^{4}{\left (a + b x \right )}}{256 b^{4}} & \text {for}\: b \neq 0 \\\frac {x^{4} \cos ^{4}{\left (a \right )}}{4} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 108, normalized size = 0.63 \begin {gather*} \frac {3}{32} \, x^{4} + \frac {3 \, {\left (8 \, b^{2} x^{2} - 1\right )} \cos \left (4 \, b x + 4 \, a\right )}{1024 \, b^{4}} + \frac {3 \, {\left (2 \, b^{2} x^{2} - 1\right )} \cos \left (2 \, b x + 2 \, a\right )}{16 \, b^{4}} + \frac {{\left (8 \, b^{3} x^{3} - 3 \, b x\right )} \sin \left (4 \, b x + 4 \, a\right )}{256 \, b^{4}} + \frac {{\left (2 \, b^{3} x^{3} - 3 \, b x\right )} \sin \left (2 \, b x + 2 \, a\right )}{8 \, b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.80, size = 138, normalized size = 0.80 \begin {gather*} \frac {\frac {3\,{\sin \left (2\,a+2\,b\,x\right )}^2}{512}-b^2\,\left (\frac {3\,x^2\,\left (2\,{\sin \left (2\,a+2\,b\,x\right )}^2-1\right )}{128}+\frac {3\,x^2\,\left (2\,{\sin \left (a+b\,x\right )}^2-1\right )}{8}\right )-b\,\left (\frac {3\,x\,\sin \left (2\,a+2\,b\,x\right )}{8}+\frac {3\,x\,\sin \left (4\,a+4\,b\,x\right )}{256}\right )+b^3\,\left (\frac {x^3\,\sin \left (2\,a+2\,b\,x\right )}{4}+\frac {x^3\,\sin \left (4\,a+4\,b\,x\right )}{32}\right )+\frac {3\,{\sin \left (a+b\,x\right )}^2}{8}}{b^4}+\frac {3\,x^4}{32} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________